package com.example.demo;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/return")

public class ReturnController {

    @RequestMapping("/package")
    public String r1(){
        return "/hello/index.html";
    }

    @ResponseBody
    @RequestMapping("/returnjson")
    public Person r2() {
        Person person = new Person();
        person.setName("zhangsan");
        person.setAge(30);
        person.setPassword("123456");
        return person;
    }
}
